<template>
  <div>
    <h1>home</h1>
    <button @click.once="sign">{{ tip }}</button>
  </div>
</template>

<script setup>
import { onMounted, ref } from "vue";

const tip = ref("");
onMounted(() => {
  tip.value = JSON.parse(sessionStorage.getItem("sign") || "{}") ? "已打卡" : "未打卡";
});

const sign = () => {
  alert("打卡完成");
  sessionStorage.setItem("sign", true);
};
</script>

<style scoped></style>
